﻿<div ng-controller="setCustserMsgController">
    <!-- begin breadcrumb -->
    <ol class="breadcrumb pull-right">
        <li><a ui-sref="app.home">汇票线</a></li>
        <li><a ui-sref="app.setting">消息管理</a></li>
        <li class="active">客服消息设置</li>
    </ol>
    <!-- end breadcrumb -->
    <!-- begin page-header -->
    <h1 class="page-header"><i class="fa fa-lg text-success fa-cog"></i> 客服消息设置</h1>
    <!-- end page-header -->
    <!-- begin row -->
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-repeat"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-danger" data-click="panel-remove"><i class="fa fa-times"></i></a>
                    </div>
                    <h4 class="panel-title">客服消息设置</h4>
                </div>
                <div class="panel-body">
                    <div class="form-inline filter-option">
                        <div class="row">
                            <div class="col-md-12">
                                <!--<div class="pull-left">
                                    <button class="btn btn-info" ng-click="exportExcel()">信息导出（Excel）</button>
                                </div>-->
                                <div class="pull-right">
                                    <input  class="form-control" type="text" ng-model="filter.custserName" placeholder="客服姓名">
                                    <input class="form-control" type="text" ng-model="filter.custserPhone" placeholder="手机号码">
                                    <select class="form-control" ng-model="filter.isOnline">
                                        <option value="">是否在线</option>
                                        <option value="1">是</option>
                                        <option value="0">否</option>
                                    </select>
                                    <select class="form-control" ng-model="filter.custserGroup" ng-options="item.groupCode as item.groupName for item in custserGroupData" >
                                        <option value="">客服组</option>
                                    </select>
                                    <span>
<!--
                                        <input type="radio" name="checked"  value="" ng-model="filter.checkedType" ng-change="reflash()"> 全部
-->
                                    </span>
                                    &nbsp;&nbsp;&nbsp;
                                    <button class="btn btn-sm btn-info" ng-click="refresh()"><i class="fa fa-search"></i> 筛选</button>
                                    <button class="btn btn-sm btn-info" ng-click="edit()"><i class="fa fa-plus-circle"></i> 新增</button>
                                </div>
                               
                            </div>
                            <!--<div class="col-md-12">
                                <div class="pull-left">
                                    <button class="btn btn-sm btn-info" ng-click="reflash()"><i class="fa fa-edit"></i> 编辑</button>
                                    <button class="btn btn-sm btn-info" ng-click="reflash()"><i class="fa fa-trash-o"></i> 删除</button>

                                </div>
                            </div>-->
                        </div>
                    </div>
                    <table id="data-table" ng-table="tableParams" template-pagination="template/pagination.html" class="table table-striped table-bordered table-hover table-condensed">
                        <tr ng-repeat="item in $data">
                            <!--<td><input type="checkbox" {{item.id}}/></td>-->
                            <td data-title="'序号'" width="10%" class="text-center">{{ first + $index }}</td>
                            <td data-title="'客服名'"  class="text-center">{{ item.custserName }}</td>
                            <td data-title="'手机号码'"  class="text-center">{{ item.custserPhone }}</td>
                            <td data-title="'工作时间段'"  class="text-right">{{ item.workStartTime }}-{{ item.workEndTime }}</td>
                            <td data-title="'是否在线'" class="text-center">{{ item.isOnline==1?'是':'否' }}</td>
                            <td data-title="'客服组'" class="text-left">{{ item.custserGroup }}</td>
                            <td data-title="'添加时间'" class="text-left">{{ item.crTime| date :'yyyy-MM-dd HH:mm:ss' }}</td>

                            <td class="text-center width-100 text-nowrap">
                                <button class="btn btn-info btn-xs" ng-click="edit(item)" >编辑</button>
                                <button class="btn btn-success btn-xs" ng-click="remove(item)" >删除</button>
                            </td>
                        </tr>
                    </table>
                </div>
                
                <div class="modal fade" id="modal-add">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <ng-form name="addForm" novalidate>
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                    <h4 class="modal-title"><i class="fa fa-lg fa-edit text-success"></i>新增客服</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="form-horizontal form-inline">
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 客服名: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="address_code" ng-model="model.custserName" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <div class="form-group width-full" >
                                            <label class="col-md-3 control-label"><font color="red">*</font> 手机号码: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="address_name" ng-model="model.custserPhone" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 工作开始时间: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="address_name" ng-model="model.workStartTime" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 工作结束时间: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="address_name" ng-model="model.workEndTime" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 用户组: </label>
                                            <div class="col-md-8">
                                                <select required="" class="form-control" ng-model="model.custserGroup" ng-options="item.groupCode as item.groupName for item in custserGroupData" >
                                                    <option value="">请选择用户组</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 是否在线: </label>
                                            <div class="col-md-8">
                                                    <span>
                                                        <input type="radio" name="checked" ng-checked="model.isOnline" value="1" class="form-control"
                                                               ng-model="model.isOnline" ng-change="reflash()"> 是
                                                        <input type="radio" name="checked" value="0" ng-model="model.isOnline" class="form-control " ng-checked="model.isOnline"
                                                               > 否
                                                    </span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="submit" class="btn btn-sm btn-success" ng-click="save()" ng-disabled="addForm.$invalid"><i class="fa fa-save"></i> 保存</button>
                                    <button type="button" class="btn btn-sm btn-white" data-dismiss="modal"><i class="fa fa-share-square-o"></i> 关闭</button>
                                </div>
                            </ng-form>
                        </div>
                    </div>
                </div>
                <div class="modal fade" id="modal-edit">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <ng-form name="editForm" novalidate>
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                    <h4 class="modal-title"><i class="fa fa-lg fa-edit text-success"></i>新增客服</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="form-horizontal form-inline">
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 客服名: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="address_code" ng-model="model.custserName" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 手机号码: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="address_name" ng-model="model.custserPhone" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 工作开始时间: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="address_name" ng-model="model.workStartTime" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 工作结束时间: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="address_name" ng-model="model.workEndTime" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 用户组: </label>
                                            <div class="col-md-8">
                                                <select required="" class="form-control" ng-model="model.custserGroup" ng-options="item.groupCode as item.groupName for item in custserGroupData">
                                                    <option value="">请选择用户组</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 是否在线: </label>
                                            <div class="col-md-8">
                                                <span>
                                                    <input type="radio" name="checked" ng-checked="model.isOnline" value="1" class="form-control"
                                                           ng-model="model.isOnline" > 是
                                                    <input type="radio" name="checked" ng-checked="model.isOnline" value="0" ng-model="model.isOnline" class="form-control "
                                                           > 否
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="submit" class="btn btn-sm btn-success" ng-click="save()" ng-disabled="addForm.$invalid"><i class="fa fa-save"></i> 保存</button>
                                    <button type="button" class="btn btn-sm btn-white" data-dismiss="modal"><i class="fa fa-share-square-o"></i> 关闭</button>
                                </div>
                            </ng-form>
                        </div>
                    </div>
                </div>


            </div>
        </div>
    </div>
</div>

